#include <vector>
using namespace std;
vector<vector<int>> generate(int numRows) {
  vector<vector<int>> res;
  res.push_back({1});
  if (numRows == 1)
    return res;
  res.push_back({1, 1});
  if (numRows == 2)
    return res;
  for (int i = 2; i < numRows; ++i) {
    vector<int> tmp;
    auto &t = res.back();
    tmp.push_back(t.front());
    for (int j = 1; j < t.size(); ++j) {
      tmp.push_back(t[j - 1] + t[j]);
    }
    tmp.push_back(t.back());
    res.push_back(tmp);
  }
  return res;
}